package com.yy.job.core.domain;

import java.io.Serializable;

public class JobResult implements Serializable {

	private static final long serialVersionUID = 8762202481525686824L;

	private boolean success = false;

	/**
	 * 报错信息
	 */
	private String errorMsg;
	
	/**
	 * 系统异常时候的堆栈
	 */
	private String errStack;
	
	public JobResult() {
		
	}
	
	public JobResult(boolean success) {
		this.success = success;
	}
	
	public JobResult(String errorMsg, String errStack) {
		this.errorMsg = errorMsg;
		this.errStack = errStack;
	}

	public JobResult(boolean success, String errorMsg, String errStack) {
		this.success = success;
		this.errorMsg = errorMsg;
		this.errStack = errStack;
	}
	
	public static JobResult success() {
		return new JobResult(true);
	}
	
	public static JobResult fail(String errorMsg, String errorStack) {
		return new JobResult(false, errorMsg, errorStack);
	}

	public boolean isSuccess() {
		return this.success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public String getErrorMsg() {
		return this.errorMsg;
	}

	public void setErrorMsg(String errorMsg) {
		this.errorMsg = errorMsg;
	}

	public String getErrStack() {
		return this.errStack;
	}

	public void setErrStack(String errStack) {
		this.errStack = errStack;
	}
	
}
